import request from '@/utils/request'

const api = {
  addMoldDocUrl: '/mold_doc/add_molddoc',
  getMoldDocPageUrl: '/mold_doc/get_molddoc_page',
  addMoldCavityUrl: '/mold_cavity/add_mold_cavity',
  getCavityListUrl: '/mold_cavity/get_cavitys',
  addCavityInvUrl: '/mold_cavity/add_cavity_inv',
  getInvByCavityUrl: '/mold_cavity/get_inv_bycavity',
  addMoldWhUrl: '/mold_stock/add_mold_wh',
  getMoldWhPageUrl: '/mold_stock/get_moldwh_page',
  updateMoldWhUrl: '/mold_stock/update_moldwh',
  deleteMoldWhUrl: '/mold_stock/delete_moldwh',
  getByInvpkUrl: '/mold_cavity/get_by_invpk',
  getInBillPageUrl: '/mold_out_inbill/get_in_bill_page',
  getInoutTypeUrl: '/mold_inout_type/get_type',
  addInbillUrl: '/mold_out_inbill/add_inbill',
  getInBillBUrl: '/mold_out_inbill/get_in_bill_b',
  updateInbillUrl: '/mold_out_inbill/update_inbill',
  getMoldStockPageUrl: '/mold_stock/get_mold_stock_page',
  deleteInbillUrl: '/mold_out_inbill/delete_inbill',
  getOutBillPageUrl: '/mold_out_inbill/get_out_bill_page',
  removeCavityUrl: '/mold_cavity/remove_cavity',
  deleteCavityInvUrl: '/mold_cavity/delete_cavity_inv',
  changeCavityInvUrl: '/mold_cavity/change_cavity_inv',
  getMoldInBillUrl: '/mold_out_inbill/get_out_forapp',
  xiaMoldInBillUrl: '/mold_out_inbill/xiamu',
  addOutbillUrl: '/mold_out_inbill/add_outbill',
}

export async function addOutbillApi(data: Map<string, any>) {
  const res = await request({
    url: api.addOutbillUrl,
    method: 'post',
    data,
  })
  return res
}

export async function xiaMoldInBillApi(data: Map<string, any>) {
  const res = await request({
    url: api.xiaMoldInBillUrl,
    method: 'post',
    data,
  })
  return res
}

export async function getMoldInBillApi(params: Map<string, any>) {
  const res = await request({
    url: api.getMoldInBillUrl,
    method: 'get',
    params: params,
  })
  return res
}

export async function changeCavityInvApi(data: Map<string, any>) {
  const res = await request({
    url: api.changeCavityInvUrl,
    method: 'post',
    data,
  })
  return res
}

export async function deleteCavityInvApi(params: Map<string, any>) {
  const res = await request({
    url: api.deleteCavityInvUrl,
    method: 'get',
    params: params,
  })
  return res
}

export async function removeCavityApi(params: Map<string, any>) {
  const res = await request({
    url: api.removeCavityUrl,
    method: 'get',
    params: params,
  })
  return res
}

export async function getOutBillPageApi(data: Map<string, any>) {
  const res = await request({
    url: api.getOutBillPageUrl,
    method: 'post',
    data,
  })
  return res
}

export async function deleteInbillApi(data: Map<string, any>) {
  const res = await request({
    url: api.deleteInbillUrl,
    method: 'post',
    data,
  })
  return res
}

export async function getMoldStockPageApi(data: Map<string, any>) {
  const res = await request({
    url: api.getMoldStockPageUrl,
    method: 'post',
    data,
  })
  return res
}
export async function updateInbillApi(data: Map<string, any>) {
  const res = await request({
    url: api.updateInbillUrl,
    method: 'post',
    data,
  })
  return res
}
export async function getInBillBApi(params: Map<string, any>) {
  const res = await request({
    url: api.getInBillBUrl,
    method: 'get',
    params: params,
  })
  return res
}
export async function addInbillApi(data: Map<string, any>) {
  const res = await request({
    url: api.addInbillUrl,
    method: 'post',
    data,
  })
  return res
}

export async function getInoutTypeApi(params: Map<string, any>) {
  const res = await request({
    url: api.getInoutTypeUrl,
    method: 'get',
    params: params,
  })
  return res
}

export async function deleteMoldWhApi(params: Map<string, any>) {
  const res = await request({
    url: api.deleteMoldWhUrl,
    method: 'get',
    params: params,
  })
  return res
}

export async function updateMoldWhApi(data: Map<string, any>) {
  const res = await request({
    url: api.updateMoldWhUrl,
    method: 'post',
    data,
  })
  return res
}

export async function getMoldWhPageApi(data: Map<string, any>) {
  const res = await request({
    url: api.getMoldWhPageUrl,
    method: 'post',
    data,
  })
  return res
}

export async function addMoldWhApi(data: Map<string, any>) {
  const res = await request({
    url: api.addMoldWhUrl,
    method: 'post',
    data,
  })
  return res
}

export async function getMoldDocPageApi(data: Map<string, any>) {
  const res = await request({
    url: api.getMoldDocPageUrl,
    method: 'post',
    data,
  })
  return res
}

export async function addMoldDocApi(data: Map<string, any>) {
  const res = await request({
    url: api.addMoldDocUrl,
    method: 'post',
    data,
  })
  return res
}

export async function addMoldCavityUrl(data: { [key: string]: any }) {
  const res = await request({
    url: api.addMoldCavityUrl,
    method: 'post',
    data,
  })
  return res
}

export async function getCavityListApi(data: { [key: string]: any }) {
  const res = await request({
    url: api.getCavityListUrl,
    method: 'post',
    data,
  })
  return res
}

export async function addCavityInvApi(data: { [key: string]: any }) {
  const res = await request({
    url: api.addCavityInvUrl,
    method: 'post',
    data,
  })
  return res
}

export async function getInvByCavityApi(params: Map<string, any>) {
  const res = await request({
    url: api.getInvByCavityUrl,
    method: 'get',
    params: params,
  })
  return res
}
export async function getByInvpkApi(params: Map<string, any>) {
  const res = await request({
    url: api.getByInvpkUrl,
    method: 'get',
    params: params,
  })
  return res
}

export async function getInBillPageApi(data: Map<string, any>) {
  const res = await request({
    url: api.getInBillPageUrl,
    method: 'post',
    data,
  })
  return res
}
